"""
案例2 【发送表单格式的post请求】，使用requests库，完成登录接口调用，返回“验证码错
误”即可
请求地址是： http://127.0.0.1/index.php?m=Home&c=User&a=do_login&t=0.999687125390627
请求头：Content-Type: application/x-www-form-urlencoded;charset=UTF-8
-请求体：username=13800000000&password=123456&verify_code=8888
"""
#导包
import requests
#发送接口请求
res= requests.post(url="http://127.0.0.1/index.php?m=Home&c=User&a=do_login&t=0.999687125390627",
                   # headers={"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},
                   data={"username":"13800000000","password":"123456","verify_code":"8888"})
#查看响应数据  以json格式返回信息
print(res.text)
print(res.json())
print(res.status_code)
print(res.cookies)
print(res.headers)
print(res.url)
print(res.encoding)

